<template>
  <div class="risk-group">
    <div class="risk-group__row">
      <RiskItem
        v-for="item in data"
        :key="item.id"
        :label="item.name"
        :value="item.riskLevel"
      >
        <template #icon>
          <image :src="item.icon" class="risk-group__item-icon" />
        </template>
      </RiskItem>
    </div>
  </div>
</template>

<script setup lang="ts">
import { IWeatherItem } from "@/apis/types/home";
import RiskItem from "./risk-item.vue";

defineOptions({
  name: "risk-group",
});

withDefaults(
  defineProps<{
    data: IWeatherItem[];
  }>(),
  {
    data: () => [],
  }
);
</script>

<style lang="less">
.risk-group {
  --nut-noticebar-box-padding: 0;
  &__row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    overflow-x: scroll;
    overflow-y: hidden;
    &::-webkit-scrollbar {
      display: none;
    }
  }
  &__item {
    &-icon {
      width: 36px;
      height: 36px;
    }
  }
}
</style>
